﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            //声明字符串
            string str = "让编程学习不再难,让编程创造财富不再难,让编程改变工作和人生不再难";
            char[] separator = { ',' };//声明分割字符的数组
            //分割字符串
            string[] splitStrings = str.Split(separator, StringSplitOptions.RemoveEmptyEntries);
            //使用for循环遍历数组，并输出
            for (int i = 0; i < splitStrings.Length; i++)
            {
                Console.WriteLine(splitStrings[i]);
            }
            Console.ReadLine();
        }
    }
}
